using System.Collections;
using UnityEngine;

public class EffectTNT : MonoBehaviour
{
	public ParticleSystem parS;

	public AudioSource ads;

	public CircleCollider2D circleCollider2D;

	private bool playing;

	public float maxRadius;

	public void Play()
	{
		parS.Clear();
		parS.Play();
		ads.Play();
		playing = true;
		circleCollider2D.enabled = true;
		StartCoroutine(_delay());
	}

	private IEnumerator _delay()
	{
		yield return new WaitForSecondsRealtime(5f);
		UnityEngine.Object.Destroy(base.gameObject);
	}

	private void FixedUpdate()
	{
		if (playing)
		{
			if (circleCollider2D.radius < maxRadius)
			{
				circleCollider2D.radius += 0.1f;
				return;
			}
			circleCollider2D.enabled = false;
			playing = false;
		}
		else if (circleCollider2D.enabled)
		{
			circleCollider2D.enabled = false;
		}
	}
}
